
const tokens = {
  admin: {
    token: 'admin-token'
  },
  editor: {
    token: 'editor-token'
  },
  lihao: {
    token: 'lihao-token'
  }
}

const users = {
  'admin-token': {
    roleIdList: ['admin'],
    introduction: 'I am a super administrator',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    username: 'Super Admin'
  },
  'editor-token': {
    roleIdList: ['editor'],
    introduction: 'I am an editor',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    username: 'Normal Editor'
  },
  'lihao-token': {
    roleIdList: ['admin'],
    introduction: '最亮的仔，还是超级管理员',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    username: '李浩'
  },
}

const routerData = {
  "menuList": [
    {
      "menuId": 348,
      "parentId": 0,
      "parentName": null,
      "name": "数据图表",
      "url": "/charts",
      "perms": "",
      "type": 0,
      "icon": "tachometer-alt",
      "orderNum": 0,
      "open": null,
      "list": [
        {
          "menuId": 349,
          "parentId": 348,
          "parentName": null,
          "name": "饼状图",
          "url": "/pie",
          "perms": "",
          "type": 1,
          "icon": "chart-pie",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 350,
          "parentId": 348,
          "parentName": null,
          "name": "折线图",
          "url": "/line",
          "perms": "",
          "type": 1,
          "icon": "chart-area",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 351,
          "parentId": 348,
          "parentName": null,
          "name": "折线图-时间线",
          "url": "/lineTime",
          "perms": "",
          "type": 1,
          "icon": "chart-line",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 352,
          "parentId": 348,
          "parentName": null,
          "name": "折线+柱状",
          "url": "/mix-line-bar",
          "perms": "",
          "type": 1,
          "icon": "tachometer-alt",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 353,
          "parentId": 348,
          "parentName": null,
          "name": "雷达图",
          "url": "/raddar",
          "perms": "",
          "type": 1,
          "icon": "tachometer-alt",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 354,
          "parentId": 348,
          "parentName": null,
          "name": "柱状图",
          "url": "/bar",
          "perms": "",
          "type": 1,
          "icon": "chart-bar",
          "orderNum": 0,
          "open": null,
          "list": null
        }
      ]
    },
    {
      "menuId": 359,
      "parentId": 0,
      "parentName": null,
      "name": "表格",
      "url": "/table",
      "perms": "",
      "type": 0,
      "icon": "table",
      "orderNum": 0,
      "open": null,
      "list": [
        {
          "menuId": 360,
          "parentId": 359,
          "parentName": null,
          "name": "拖动表格",
          "url": "/drag-table",
          "perms": "",
          "type": 1,
          "icon": "bullseye",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 361,
          "parentId": 359,
          "parentName": null,
          "name": "内联表格",
          "url": "/inline-edit-table",
          "perms": "",
          "type": 1,
          "icon": "th",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 363,
          "parentId": 359,
          "parentName": null,
          "name": "基础表格-无筛选",
          "url": "/layout-table1",
          "perms": "",
          "type": 1,
          "icon": "th",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 364,
          "parentId": 359,
          "parentName": null,
          "name": "基础表格-单行筛选",
          "url": "/layout-table2",
          "perms": "",
          "type": 1,
          "icon": "th",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 365,
          "parentId": 359,
          "parentName": null,
          "name": "基础表格-多行筛选",
          "url": "/layout-table3",
          "perms": "",
          "type": 1,
          "icon": "th",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 366,
          "parentId": 359,
          "parentName": null,
          "name": "基础表格-折叠筛选区",
          "url": "/layout-table",
          "perms": "",
          "type": 1,
          "icon": "th",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 367,
          "parentId": 359,
          "parentName": null,
          "name": "基础表格-树形区域",
          "url": "/layout-table4",
          "perms": "",
          "type": 1,
          "icon": "th",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 368,
          "parentId": 359,
          "parentName": null,
          "name": "基础表格-表格过宽",
          "url": "/layout-table5",
          "perms": "",
          "type": 1,
          "icon": "th",
          "orderNum": 0,
          "open": null,
          "list": null
        }
      ]
    },
    {
      "menuId": 369,
      "parentId": 0,
      "parentName": null,
      "name": "弹框",
      "url": "/dialog",
      "perms": "",
      "type": 0,
      "icon": "window-restore",
      "orderNum": 0,
      "open": null,
      "list": [
        {
          "menuId": 370,
          "parentId": 369,
          "parentName": null,
          "name": "基础弹框",
          "url": "/basics-dialog",
          "perms": "",
          "type": 1,
          "icon": "clone",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 371,
          "parentId": 369,
          "parentName": null,
          "name": "全屏弹框",
          "url": "/basics-dialog1",
          "perms": "",
          "type": 1,
          "icon": "clone",
          "orderNum": 0,
          "open": null,
          "list": null
        }
      ]
    },
    {
      "menuId": 372,
      "parentId": 0,
      "parentName": null,
      "name": "组件",
      "url": "/components-demo",
      "perms": "",
      "type": 0,
      "icon": "layer-group",
      "orderNum": 0,
      "open": null,
      "list": [
        {
          "menuId": 373,
          "parentId": 372,
          "parentName": null,
          "name": "拖放上传图片",
          "url": "/dropzone",
          "perms": "",
          "type": 1,
          "icon": "upload",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 374,
          "parentId": 372,
          "parentName": null,
          "name": "计数器",
          "url": "/count-to",
          "perms": "",
          "type": 1,
          "icon": "calculator",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 375,
          "parentId": 372,
          "parentName": null,
          "name": "组件小动效",
          "url": "/mixin",
          "perms": "",
          "type": 1,
          "icon": "fan",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 376,
          "parentId": 372,
          "parentName": null,
          "name": "下拉选择",
          "url": "/drag-select",
          "perms": "",
          "type": 1,
          "icon": "caret-square-down",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 377,
          "parentId": 372,
          "parentName": null,
          "name": "列表可拖动",
          "url": "/dnd-list",
          "perms": "",
          "type": 1,
          "icon": "expand-arrows-alt",
          "orderNum": 0,
          "open": null,
          "list": null
        }
      ]
    },
    {
      "menuId": 142,
      "parentId": 0,
      "parentName": null,
      "name": "权限管理",
      "url": "/permission",
      "perms": "",
      "type": 0,
      "icon": "shield-alt",
      "orderNum": 30,
      "open": null,
      "list": [
        {
          "menuId": 262,
          "parentId": 142,
          "parentName": null,
          "name": "菜单管理",
          "url": "/menu",
          "perms": "",
          "type": 1,
          "icon": "bars",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 326,
          "parentId": 142,
          "parentName": null,
          "name": "部门管理",
          "url": "/dept",
          "perms": "",
          "type": 1,
          "icon": "hotel",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 328,
          "parentId": 142,
          "parentName": null,
          "name": "用户管理",
          "url": "/user",
          "perms": "",
          "type": 1,
          "icon": "user-cog",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 334,
          "parentId": 142,
          "parentName": null,
          "name": "字典管理",
          "url": "/dictionary",
          "perms": "",
          "type": 1,
          "icon": "book",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 335,
          "parentId": 142,
          "parentName": null,
          "name": "系统日志",
          "url": "/log",
          "perms": "",
          "type": 1,
          "icon": "file-alt",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 336,
          "parentId": 142,
          "parentName": null,
          "name": "参数配置",
          "url": "/config",
          "perms": "",
          "type": 1,
          "icon": "tools",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 337,
          "parentId": 142,
          "parentName": null,
          "name": "定时任务",
          "url": "/schedule",
          "perms": "",
          "type": 1,
          "icon": "clock",
          "orderNum": 0,
          "open": null,
          "list": null
        },
        {
          "menuId": 3,
          "parentId": 142,
          "parentName": null,
          "name": "角色管理",
          "url": "/role",
          "perms": null,
          "type": 1,
          "icon": "user-tie",
          "orderNum": 2,
          "open": null,
          "list": null
        }
      ]
    }
  ],
  "permissions": [
    "sys:schedule:info",
    "sys:menu:update",
    "sys:menu:delete",
    "sys:dict:delete",
    "sys:menu:list",
    "sys:config:save",
    "sys:sys-dept:save",
    "sys:config:update",
    "sys:user:delete",
    "sys:config:list",
    "sys:user:update",
    "sys:role:list",
    "sys:menu:info",
    "sys:menu:select",
    "sys:schedule:update",
    "sys:schedule:save",
    "sys:role:select",
    "sys:dict:list",
    "sys:sys-dept:select",
    "sys:user:list",
    "sys:dict:info",
    "sys:menu:save",
    "sys:role:save",
    "sys:role:info",
    "sys:schedule:delete",
    "sys:sys-dept:list",
    "sys:role:update",
    "sys:user:info",
    "sys:schedule:list",
    "sys:config:delete",
    "sys:sys-dept:update",
    "sys:role:delete",
    "sys:user:save",
    "sys:dict:update",
    "sys:sys-dept:delete",
    "sys:dict:save",
    "sys:log:list"
  ]
}
module.exports = [

  // user login
  // {
  //   url: '/admin/sys/login/manage/login',
  //   type: 'post',
  //   response: config => {
  //     const { username } = config.body
  //     const token = tokens[username]

  //     // mock error
  //     if (!token) {
  //       return {
  //         code: 60204,
  //         message: '帐号或密码不正确.'
  //       }
  //     }

  //     return {
  //       code: 200,
  //       data: token
  //     }
  //   }
  // },

  // get user info
  // {
  //   url: '/admin/sys/login/manage/getUserInfo',
  //   type: 'get',
  //   response: config => {
  //     const { token } = config.query
  //     const info = users[token]

  //     // mock error
  //     if (!info) {
  //       return {
  //         code: 50008,
  //         message: '登录失败，无法获取用户详细信息.'
  //       }
  //     }

  //     return {
  //       code: 200,
  //       data: info
  //     }
  //   }
  // },

  //路由数据
  // {
  //   url: '/admin/sys/login/manage/findNavigationList',
  //   type: 'get',
  //   response: _ => {

  //     return {
  //       code: 200,
  //       data: routerData
  //     }
  //   }
  // },

  // 退出登录
  // {
  //   url: '/admin/sys/login/manage/logout',
  //   type: 'post',
  //   response: _ => {
  //     return {
  //       code: 200,
  //       data: 'success'
  //     }
  //   }
  // }
]
